package org.amphiprion.descentv2assistant.entity;

import java.util.UUID;

import android.database.Cursor;

public class GameSession extends Entity implements Comparable<GameSession> {
	private String name;
	private final boolean visible;
	private int numberOfHeroes;
	private int overlordXp;

	public GameSession(Cursor cursor) {
		id = cursor.getString(cursor.getColumnIndex("id"));
		name = cursor.getString(cursor.getColumnIndex("name"));
		visible = cursor.getInt(cursor.getColumnIndex("toshow")) == 1;
		numberOfHeroes = cursor.getInt(cursor.getColumnIndex("nb_heroes"));
		overlordXp = cursor.getInt(cursor.getColumnIndex("ol_xp"));

	}

	public GameSession() {
		super(UUID.randomUUID().toString());
		visible = true;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isVisible() {
		return visible;
	}

	@Override
	public int compareTo(GameSession another) {
		return name.compareTo(another.name);
	}

	public int getNumberOfHeroes() {
		return numberOfHeroes;
	}

	public void setNumberOfHeroes(int numberOfHeroes) {
		this.numberOfHeroes = numberOfHeroes;
	}

	public int getOverlordXp() {
		return overlordXp;
	}

	public void setOverlordXp(int overlordXp) {
		this.overlordXp = overlordXp;
	}

}
